home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / emacs.lha / emacs-19.16 / info / emacs-14 (.txt) < prev    next >
GNU Info File  |  1993-07-06  |  49KB  |  889 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: General Calendar,  Next: Holidays,  Prev: Counting Days,  Up: Calendar/Diary
  4. Miscellaneous Calendar Commands
  5. ===============================
  6. `p d'
  7.      Display day-in-year (`calendar-print-day-of-year').
  8. `C-c C-l'
  9.      Regenerate the calendar window (`redraw-calendar').
  10.      Exit from calendar (`exit-calendar').
  11.    To print the number of days elapsed since the start of the year, or
  12. the number of days remaining in the year, type the `p d' command
  13. (`calendar-print-day-of-year').  This displays both of those numbers in
  14. the echo area.  The number of days elapsed includes the selected date.
  15. The number of days remaining does not include that date.
  16.    If the calendar window gets corrupted, type `C-c C-l'
  17. (`redraw-calendar') to redraw it.
  18.    To exit from the calendar, type `q' (`exit-calendar').  This buries
  19. all buffers related to the calendar and returns the window display to
  20. what it was when you entered the calendar.
  21. File: emacs,  Node: Holidays,  Next: Sunrise/Sunset,  Prev: General Calendar,  Up: Calendar/Diary
  22. Holidays
  23. ========
  24.    The Emacs calendar knows about all major and many minor holidays,
  25. and can display them.
  26.      Display holidays for the selected date
  27.      (`calendar-cursor-holidays').
  28.      Mark holidays in the calendar window (`mark-calendar-holidays').
  29.      Unmark calendar window (`calendar-unmark').
  30.      List all holidays for the displayed three months in another window
  31.      (`list-calendar-holidays').
  32. `M-x holidays'
  33.      List all holidays for three months around today's date in another
  34.      window.
  35.    To see if any holidays fall on a given date, position point on that
  36. date in the calendar window and use the `h' command.  This names the
  37. holidays for that date, in the echo area if they fit there, otherwise
  38. in a separate window.
  39.    To find the distribution of holidays for a wider period, use the `x'
  40. command.  This displays a `*' after each date on which a holiday falls.
  41. The command applies both to the currently visible months and to other
  42. months that subsequently become visible by scrolling.  To turn marking
  43. off and erase the current marks, type `u', which also erases any diary
  44. marks (*note Diary::.).
  45.    To get even more detailed information, use the `a' command, which
  46. displays a separate buffer containing a list of all holidays in the
  47. current three-month range.
  48.    The command `M-x holidays' displays the list of holidays for the
  49. current month and the preceding and succeeding months; this works even
  50. if you don't have a calendar window.  If you want the list of holidays
  51. centered around a different month, use `C-u M-x holidays', which
  52. prompts for the month and year.
  53.    The holidays known to Emacs include American holidays and the major
  54. Christian, Jewish, and Islamic holidays; when floating point is
  55. available, the calendar also knows about solstices and equinoxes.
  56.    The dates used by Emacs for holidays are based on *current
  57. practice*, not historical fact.  Historically, for instance, the start
  58. of daylight savings time and even its existence have varied from year to
  59. year, but present American law mandates that daylight savings time
  60. begins on the first Sunday in April.  Emacs always uses this definition,
  61. even though it is wrong for some prior years.
  62. File: emacs,  Node: Sunrise/Sunset,  Next: Lunar Phases,  Prev: Holidays,  Up: Calendar/Diary
  63. Times of Sunrise and Sunset
  64. ===========================
  65.    Emacs can tell you, to within a minute or two, the times of sunrise
  66. and sunset for any date, if floating point is available.
  67.      Display times of sunrise and sunset for the selected date
  68.      (`calendar-sunrise-sunset').
  69. `M-x sunrise-sunset'
  70.      Display times of sunrise and sunset for today's date.
  71. `C-u M-x sunrise-sunset'
  72.      Display times of sunrise and sunset for a specified date.
  73.    Within the calendar, to display the *local times* of sunrise and
  74. sunset in the echo area, move point to the date you want, and type `S'.
  75.    The command `M-x sunrise-sunset' is available outside the calendar
  76. to print this information for today's date or a specified date.  To
  77. specify a date other than today, use `C-u M-x sunrise-sunset', which
  78. prompts for the year, month, and day.
  79.    Because the times of sunrise and sunset depend on the location on
  80. earth, you need to tell Emacs your latitude, longitude, and location
  81. name before using these commands.  Here is an example of what to set:
  82.      (setq calendar-latitude 40.1)
  83.      (setq calendar-longitude -88.2)
  84.      (setq calendar-location-name "Urbana, IL")
  85. Use one decimal place in the values of `calendar-latitude' and
  86. `calendar-longitude'.
  87.    Your time zone also affects the local time of sunrise and sunset.
  88. Emacs usually gets this information from the operating system, but if
  89. these values are not what you want (or if the operating system does not
  90. supply them), you must set them yourself.  Here is an example:
  91.      (setq calendar-time-zone -360)
  92.      (setq calendar-standard-time-zone-name "CST")
  93.      (setq calendar-daylight-time-zone-name "CDT")
  94. The value of `calendar-time-zone' is the number of minutes difference
  95. between your local standard time and Coordinated Universal Time
  96. (Greenwich time).  The values of `calendar-standard-time-zone-name' and
  97. `calendar-daylight-time-zone-name' are the abbreviations used in your
  98. time zone.
  99.    Emacs displays the times of sunrise and sunset *corrected for
  100. daylight savings time*.  The default rule for the starting and stopping
  101. dates of daylight savings time is the American rule.  *Note Daylight
  102. Savings::, for how to specify a different rule.
  103.    You can display the times of sunrise and sunset for any location and
  104. any date with `C-u C-u M-x sunrise-sunset'.  This asks you for a
  105. longitude, latitude, number of minutes difference from Coordinated
  106. Universal Time, and date, and then tells you the times of sunrise and
  107. sunset for that location on that date.
  108. File: emacs,  Node: Lunar Phases,  Next: Other Calendars,  Prev: Sunrise/Sunset,  Up: Calendar/Diary
  109. Phases of the Moon
  110. ==================
  111.    Emacs can tell you the dates and times of the phases of the moon (new
  112. moon, first quarter, full moon, last quarter), if floating point is
  113. available.  This feature is useful for debugging problems that "depend
  114. on the phase of the moon."
  115.      Display the dates and times for all the quarters of the moon for
  116.      the three-month period shown (`calendar-phases-of-moon').
  117. `M-x phases-of-moon'
  118.      Display dates and times of the quarters of the moon for three
  119.      months around today's date.
  120.    Within the calendar, use the `M' command to display a separate
  121. buffer of the phases of the moon for the current three-month range.  The
  122. dates and times listed are accurate to within a few minutes.
  123.    Outside the calendar, use the command `M-x phases-of-moon' to
  124. display the list of the phases of the moon for the current month and the
  125. preceding and succeeding months.  For information about a different
  126. month, use `C-u M-x phases-of-moon', which prompts for the month and
  127. year.
  128.    The dates and times given for the phases of the moon are given in
  129. local time (corrected for daylight savings, when appropriate); but if
  130. the variable `calendar-time-zone' is void, Coordinated Universal Time
  131. (the Greenwich time zone) is used.  *Note Daylight Savings::.
  132. File: emacs,  Node: Other Calendars,  Next: Diary,  Prev: Lunar Phases,  Up: Calendar/Diary
  133. Conversion To and From Other Calendars
  134. ======================================
  135.    The Emacs calendar displayed is *always* the Gregorian calendar,
  136. sometimes called the "new style" calendar, which is used in most of the
  137. world today.  However, this calendar did not exist before the sixteenth
  138. century and was not widely used before the eighteenth century; it did
  139. not fully displace the Julian calendar and gain universal acceptance
  140. until the early twentieth century.  The Emacs calendar can display any
  141. month since January, year 1 of the current era, but the calendar
  142. displayed is the Gregorian, even for a date at which the Gregorian
  143. calendar did not exist.
  144.    While Emacs cannot display other calendars, it can convert dates to
  145. and from several other calendars.
  146. * Menu:
  147. * Calendar Systems::      The calendars Emacs understands
  148.                 (aside from Gregorian).
  149. * To Other Calendar::     Converting the selected date to various calendars.
  150. * From Other Calendar::   Moving to a date specified in another calendar.
  151. * Mayan Calendar::      Moving to a date specified in a Mayan calendar.
  152. File: emacs,  Node: Calendar Systems,  Next: To Other Calendar,  Up: Other Calendars
  153. Supported Calendar Systems
  154. --------------------------
  155.    The ISO commercial calendar is used largely in Europe.
  156.    The Julian calendar, named after Julius Caesar, was the one used in
  157. Europe throughout medieval times, and in many countries up until the
  158. nineteenth century.
  159.    Astronomers use a simple counting of days elapsed since noon, Monday,
  160. January 1, 4713 B.C. on the Julian calendar.  The number of days elapsed
  161. is called the *Julian day number* or the *Astronomical day number*.
  162.    The Hebrew calendar is the one used to determine the dates of Jewish
  163. holidays.  Hebrew calendar dates begin and end at sunset.
  164.    The Islamic (Moslem) calendar is the one used to determine the dates
  165. of Moslem holidays.  There is no universal agreement in the Islamic
  166. world about the calendar; Emacs uses a widely accepted version, but the
  167. precise dates of Islamic holidays often depend on proclamation by
  168. religious authorities, not on calculations.  As a consequence, the
  169. actual dates of occurrence can vary slightly from the dates computed by
  170. Emacs.  Islamic calendar dates begin and end at sunset.
  171.    The French Revolutionary calendar was created by the Jacobins after
  172. the 1789 revolution, to represent a more secular and nature-based view
  173. of the annual cycle, and to install a 10-day week in a rationalization
  174. measure similar to the metric system.  The French government officially
  175. abandoned this calendar at the end of 1805.
  176.    The Maya of Central America used three separate, overlapping calendar
  177. systems, the *long count*, the *tzolkin*, and the *haab*.  Emacs knows
  178. about all three of these calendars.  Experts dispute the exact
  179. correlation between the Mayan calendar and our calendar; Emacs uses the
  180. Goodman-Martinez-Thompson correlation in its calculations.
  181. File: emacs,  Node: To Other Calendar,  Next: From Other Calendar,  Prev: Calendar Systems,  Up: Other Calendars
  182. Converting To Other Calendars
  183. -----------------------------
  184.    The following commands describe the selected date (the date at point)
  185. in various other calendar systems:
  186. `p c'
  187.      Display ISO commercial calendar equivalent for selected day
  188.      (`calendar-print-iso-date').
  189. `p j'
  190.      Display Julian date for selected day
  191.      (`calendar-print-julian-date').
  192. `p a'
  193.      Display astronomical (Julian) day number for selected day
  194.      (`calendar-print-astro-day-number').
  195. `p h'
  196.      Display Hebrew date for selected day
  197.      (`calendar-print-hebrew-date').
  198. `p i'
  199.      Display Islamic date for selected day
  200.      (`calendar-print-islamic-date').
  201. `p f'
  202.      Display French Revolutionary date for selected day
  203.      (`calendar-print-french-date').
  204. `p m'
  205.      Display Mayan date for selected day (`calendar-print-mayan-date').
  206.    Put point on the desired date of the Gregorian calendar, then type
  207. the appropriate keys.  The `p' is a mnemonic for "print" since Emacs
  208. "prints" the equivalent date in the echo area.
  209. File: emacs,  Node: From Other Calendar,  Next: Mayan Calendar,  Prev: To Other Calendar,  Up: Other Calendars
  210. Converting From Other Calendars
  211. -------------------------------
  212.    You can move to dates that you specify on the Commercial, Julian,
  213. astronomical, Hebrew, Islamic, or French calendars:
  214. `g c'
  215.      Move to a date specified in the ISO commercial calendar
  216.      (`calendar-goto-iso-date').
  217. `g j'
  218.      Move to a date specified in the Julian calendar
  219.      (`calendar-goto-julian-date').
  220. `g a'
  221.      Move to a date specified in astronomical (Julian) day number
  222.      (`calendar-goto-astro-day-number').
  223. `g h'
  224.      Move to a date specified in the Hebrew calendar
  225.      (`calendar-goto-hebrew-date').
  226. `g i'
  227.      Move to a date specified in the Islamic calendar
  228.      (`calendar-goto-islamic-date').
  229. `g f'
  230.      Move to a date specified in the French Revolutionary calendar
  231.      (`calendar-goto-french-date').
  232.    These commands ask you for a date on the other calendar, move point
  233. to the Gregorian calendar date equivalent to that date, and display the
  234. other calendar's date in the echo area.  Emacs uses strict completion
  235. (*note Completion::.) whenever it asks you to type a month name, so you
  236. don't have to worry about the spelling of Hebrew, Islamic, or French
  237. names.
  238.    One common question concerning the Hebrew calendar is the computation
  239. of the anniversary of a date of death, called a "yahrzeit."  The Emacs
  240. calendar includes a facility for such calculations.  If you are in the
  241. calendar, the command `M-x list-yahrzeit-dates' asks you for a range of
  242. years and then displays a list of the yahrzeit dates for those years
  243. for the date given by point.  If you are not in the calendar, this
  244. command first asks you for the date of death and the range of years,
  245. and then displays the list of yahrzeit dates.
  246. File: emacs,  Node: Mayan Calendar,  Prev: From Other Calendar,  Up: Other Calendars
  247. Converting from the Mayan Calendar
  248. ----------------------------------
  249.    Here are the commands to select dates based on the Mayan calendar:
  250. `g m l'
  251.      Move to a date specified by the long count calendar
  252.      (`calendar-goto-mayan-long-count-date').
  253. `g m p t'
  254.      Move to the previous occurrence of a place in the tzolkin calendar
  255.      (`calendar-previous-tzolkin-date').
  256. `g m n t'
  257.      Move to the next occurrence of a place in the tzolkin calendar
  258.      (`calendar-next-tzolkin-date').
  259. `g m p h'
  260.      Move to the previous occurrence of a place in the haab calendar
  261.      (`calendar-previous-haab-date').
  262. `g m n h'
  263.      Move to the next occurrence of a place in the haab calendar
  264.      (`calendar-next-haab-date').
  265. `g m p c'
  266.      Move to the previous occurrence of a place in the calendar round
  267.      (`calendar-previous-calendar-round-date').
  268. `g m n c'
  269.      Move to the next occurrence of a place in the calendar round
  270.      (`calendar-next-calendar-round-date').
  271.    To understand these commands, you need to understand the Mayan
  272. calendars.  The "long count" is a counting of days with these units:
  273.      1 kin = 1 day   1 uinal = 20 kin   1 tun = 18 uinal
  274.      1 katun = 20 tun   1 baktun = 20 katun
  275. Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
  276. tun, 16 uinal, and 6 kin.  The Emacs calendar can handle Mayan long
  277. count dates as early as 7.17.18.13.1, but no earlier.  When you use the
  278. `g m l' command, type the Mayan long count date with the baktun, katun,
  279. tun, uinal, and kin separated by periods.
  280.    The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of
  281. independent cycles of 13 and 20 days.  Since this cycle repeats
  282. endlessly, Emacs provides commands to move backward and forward to the
  283. previous or next point in the cycle.  Type `g m p t' to go to the
  284. previous tzolkin date; Emacs asks you for a tzolkin date and moves point
  285. to the previous occurrence of that date.  Similarly, type `g m n t' to
  286. go to the next occurrence of a tzolkin date.
  287.    The Mayan haab calendar is a cycle of 365 days arranged as 18 months
  288. of 20 days each, followed a 5-day monthless period.  Like the tzolkin
  289. cycle, this cycle repeats endlessly, and there are commands to move
  290. backward and forward to the previous or next point in the cycle.  Type
  291. `g m p h' to go to the previous haab date; Emacs asks you for a haab
  292. date and moves point to the previous occurrence of that date.
  293. Similarly, type `g m n h' to go to the next occurrence of a haab date.
  294.    The Maya also used the combination of the tzolkin date and the haab
  295. date.  This combination is a cycle of about 52 years called a *calendar
  296. round*.  If you type `g m p c', Emacs asks you for both a haab and a
  297. tzolkin date and then moves point to the previous occurrence of that
  298. combination.  Use `g m p c' to move point to the next occurrence of a
  299. combination.  Emacs signals an error if the haab/tzolkin date you have
  300. typed is impossible.
  301.    Emacs uses strict completion (*note Completion::.) whenever it asks
  302. you to type a Mayan name, so you don't have to worry about spelling.
  303. File: emacs,  Node: Diary,  Next: Appointments,  Prev: Other Calendars,  Up: Calendar/Diary
  304. The Diary
  305. =========
  306.    The Emacs diary keeps track of appointments or other events on a
  307. daily basis, in conjunction with the calendar.  To use the diary
  308. feature, you must first create a "diary file" containing a list of
  309. events and their dates.  Then Emacs can automatically pick out and
  310. display the events for today, for the immediate future, or for any
  311. specified date.
  312.    By default, Emacs uses `~/diary' as the diary file.  This is the
  313. same file that the `calendar' utility uses.  A sample `~/diary' file is:
  314.      12/22/1988 Twentieth wedding anniversary!!
  315.      &1/1. Happy New Year!
  316.      10/22 Ruth's birthday.
  317.      * 21, *: Payday
  318.      Tuesday--weekly meeting with grad students at 10am
  319.               Supowit, Shen, Bitner, and Kapoor to attend.
  320.      1/13/89 Friday the thirteenth!!
  321.      &thu 4pm squash game with Lloyd.
  322.      mar 16 Dad's birthday
  323.      April 15, 1989 Income tax due.
  324.      &* 15 time cards due.
  325.    Although you probably will start by creating a diary manually, Emacs
  326. provides a number of commands to let you view, add, and change diary
  327. entries.
  328. * Menu:
  329. * Diary Commands::         Viewing diary entries and associated calendar dates.
  330. * Format of Diary File::   Entering events in your diary.
  331. * Date Formats::       Various ways you can specify dates.
  332. * Adding to Diary::       Commands to create diary entries.
  333. * Special Diary Entries::  Anniversaries, blocks of dates, cyclic entries, etc.
  334. File: emacs,  Node: Diary Commands,  Next: Format of Diary File,  Up: Diary
  335. Commands Displaying Diary Entries
  336. ---------------------------------
  337.    Once you have created a `~/diary' file, you can view it from within
  338. the calendar.  You can also view today's events outside of Calendar
  339. mode.
  340.      Display any diary entries for the selected date
  341.      (`view-diary-entries').
  342.      Display entire diary file (`show-all-diary-entries').
  343.      Mark all visible dates that have diary entries
  344.      (`mark-diary-entries').
  345.      Unmark calendar window (`calendar-unmark').
  346. `M-x print-diary-entries'
  347.      Print hard copy of the diary display as it appears.
  348. `M-x diary'
  349.      Display any diary entries for today's date.
  350.    Displaying the diary entries with `d' shows in a separate window the
  351. diary entries for the selected date in the calendar.  The mode line of
  352. the new window shows the date of the diary entries and any holidays
  353. that fall on that date.
  354.    If you specify a numeric argument with `d', it shows all the diary
  355. entries for that many successive days.  Thus, `2 d' displays all the
  356. entries for the selected date and for the following day.
  357.    To get a broader view of which days are mentioned in the diary, use
  358. the `m' command.  This places a `+' after each date which has a diary
  359. entry.  The command applies both to the currently visible months and to
  360. other months that subsequently become visible by scrolling.  To turn
  361. marking off and erase the current marks, type `u', which also turns off
  362. holiday marks (*note Holidays::.).
  363.    To see the full diary file, rather than just some of the entries, use
  364. the `s' command.
  365.    Display of selected diary entries uses the selective display feature
  366. to hide entries that don't apply.  This is the same feature that Outline
  367. mode uses to show part of an outline (*note Outline Mode::.).  The diary
  368. buffer as you see it is an illusion, so simply printing the buffer does
  369. not print what you see on your screen.
  370.    There is a special command to print hard copy of the diary buffer
  371. *as it appears*; this command is `M-x print-diary-entries'.  It sends
  372. the data directly to the printer.  You can customize it like
  373. `lpr-region' (*note Hardcopy::.).
  374.    The command `M-x diary' displays the diary entries for the current
  375. date, independently of the calendar display, and optionally for the next
  376. few days as well; the variable `number-of-diary-entries' specifies how
  377. many days to include.  *Note Calendar/Diary Options:
  378. (elisp)Calendar/Diary Options.
  379.    If you put `(diary)' in your `.emacs' file, this automatically
  380. displays a window with the day's diary entries, when you enter Emacs.
  381. The mode line of the displayed window shows the date and any holidays
  382. that fall on that date.
  383. File: emacs,  Node: Format of Diary File,  Next: Date Formats,  Prev: Diary Commands,  Up: Diary
  384. The Diary File
  385. --------------
  386.    Your "diary file" is a file that records events associated with
  387. particular dates.  The name of the diary file is specified by the
  388. variable `diary-file'; `~/diary' is the default.  You can use the same
  389. file for the `calendar' utility program, since its formats are a subset
  390. of the ones allowed by the Emacs diary facilities.
  391.    Each entry in the diary file describes one event and consists of one
  392. or more lines.  An entry always begins with a date specification at the
  393. left margin.  The rest of the entry is simply text to describe the
  394. event.  If the entry has more than one line, then the lines after the
  395. first must begin with whitespace to indicate they continue a previous
  396. entry.  Lines that do not begin with valid dates and do not continue a
  397. preceding entry are ignored.
  398.    You can inhibit the marking of certain diary entries in the calendar
  399. window; to do this, insert an ampersand (`&') at the beginning of the
  400. entry, before the date.  This has no effect on display of the entry in
  401. the diary window; it affects only marks on dates in the calendar
  402. window.  Nonmarking entries are especially useful for generic entries
  403. that would otherwise mark many different dates.
  404.    If the first line of a diary entry consists only of the date or day
  405. name with no following blanks or punctuation, then the diary window
  406. display doesn't include that line; only the continuation lines appear.
  407. For example:
  408.      02/11/1989
  409.            Bill B. visits Princeton today
  410.            2pm Cognitive Studies Committee meeting
  411.            2:30-5:30 Liz at Lawrenceville
  412.            4:00pm Dentist appt
  413.            7:30pm Dinner at George's
  414.            8:00-10:00pm concert
  415. appears in the diary window without the date line at the beginning.
  416. This style of entry looks neater when you display just a single day's
  417. entries, but can cause confusion if you ask for more than one day's
  418. entries.
  419.    You can edit the diary entries as they appear in the window, but it
  420. is important to remember that the buffer displayed contains the *entire*
  421. diary file, with portions of it concealed from view.  This means, for
  422. instance, that the `C-f' (`forward-char') command can put point at what
  423. appears to be the end of the line, but what is in reality the middle of
  424. some concealed line.
  425.    *Be careful when editing the diary entries!*  Inserting additional
  426. lines or adding/deleting characters in the middle of a visible line
  427. cannot cause problems, but editing at the end of a line may not do what
  428. you expect.  Deleting a line may delete other invisible entries that
  429. follow it.  Before editing the diary, it is best to display the entire
  430. file with `s' (`show-all-diary-entries').
  431. File: emacs,  Node: Date Formats,  Next: Adding to Diary,  Prev: Format of Diary File,  Up: Diary
  432. Date Formats
  433. ------------
  434.    Here are some sample diary entries, illustrating different ways of
  435. formatting a date.  The examples all show dates in American order
  436. (month, day, year), but Calendar mode supports European order (day,
  437. month, year) as an option.
  438.      4/20/93  Switch-over to new tabulation system
  439.      apr. 25  Start tabulating annual results
  440.      4/30  Results for April are due
  441.      */25  Monthly cycle finishes
  442.      Friday  Don't leave without backing up files
  443.    The first entry appears only once, on April 20, 1993.  The second and
  444. third appear every year on the specified dates, and the fourth uses a
  445. wildcard (asterisk) for the month, so it appears on the 25th of every
  446. month.  The final entry appears every week on Friday.
  447.    You can use just numbers to express a date, as in `MONTH/DAY' or
  448. `MONTH/DAY/YEAR'.  This must be followed by a nondigit.  In the date
  449. itself, MONTH and DAY are numbers of one or two digits.  YEAR is a
  450. number and may be abbreviated to the last two digits; that is, you can
  451. use `11/12/1989' or `11/12/89'.
  452.    Dates can also have the form `MONTHNAME DAY' or `MONTHNAME DAY,
  453. YEAR', where the month's name can be spelled in full or abbreviated to
  454. three characters (with or without a period).  Case is not significant.
  455.    A date may be "generic", or partially unspecified.  Then the entry
  456. applies to all dates that match the specification.  If the date does not
  457. contain a year, it is generic and applies to any year.  Alternatively,
  458. MONTH, DAY, or YEAR can be a `*'; this matches any month, day, or year,
  459. respectively.  Thus, a diary entry `3/*/*' matches any day in March of
  460. any year; so does `march *'.
  461.    If you prefer the European style of writing dates--in which the day
  462. comes before the month--type `M-x european-calendar' while in the
  463. calendar, or set the variable `european-calendar-style' to `t' *before*
  464. using any calendar or diary command.  This mode interprets all dates in
  465. the diary in the European manner, and also uses European style for
  466. displaying diary dates.  (Note that there is no comma after the
  467. MONTHNAME in the European style.)  To go back to the (default) American
  468. style of writing dates, type `M-x american-calendar'.
  469.    You can use the name of a day of the week as a generic date which
  470. applies to any date falling on that day of the week.  You can abbreviate
  471. the day of the week to three letters (with or without a period) or spell
  472. it in full; case is not significant.
  473. File: emacs,  Node: Adding to Diary,  Next: Special Diary Entries,  Prev: Date Formats,  Up: Diary
  474. Commands to Add to the Diary
  475. ----------------------------
  476.    While in the calendar, there are several commands to create diary
  477. entries:
  478. `i d'
  479.      Add a diary entry for the selected date (`insert-diary-entry').
  480. `i w'
  481.      Add a diary entry for the selected day of the week
  482.      (`insert-weekly-diary-entry').
  483. `i m'
  484.      Add a diary entry for the selected day of the month
  485.      (`insert-monthly-diary-entry').
  486. `i y'
  487.      Add a diary entry for the selected day of the year
  488.      (`insert-yearly-diary-entry').
  489.    You can make a diary entry for a specific date by selecting that date
  490. in the calendar window and typing the `i d' command.  This command
  491. displays the end of your diary file in another window and inserts the
  492. date; you can then type the rest of the diary entry.
  493.    If you want to make a diary entry that applies to a specific day of
  494. the week, select that day of the week (any occurrence will do) and type
  495. `i w'.  This inserts the day-of-week as a generic date; you can then
  496. type the rest of the diary entry.
  497.    You can make a monthly diary entry in the same fashion.  Select the
  498. day of the month, use the `i m' command, and type rest of the entry.
  499. Similarly, you can insert a yearly diary entry with the `i y' command.
  500.    All of the above commands make marking diary entries.  If you want
  501. the diary entry to be nonmarking, give a prefix argument to the command.
  502. For example, `C-u i w' makes a nonmarking, weekly diary entry.
  503.    When you modify the diary file, be sure to save the file before
  504. exiting Emacs.
  505. File: emacs,  Node: Special Diary Entries,  Prev: Adding to Diary,  Up: Diary
  506. Special Diary Entries
  507. ---------------------
  508.    In addition to entries based on calendar dates, your diary file can
  509. contain "special entries" for regular events such as anniversaries.
  510. These entries are based on Lisp expressions (sexps) that Emacs evaluates
  511. as it scans the diary file.  Instead of a date, a special entry contains
  512. `%%' followed by a Lisp expression which must begin and end with
  513. parentheses.  The Lisp expression determines which dates the entry
  514. applies to.
  515.    Calendar mode provides commands to insert certain commonly used
  516. special entries:
  517. `i a'
  518.      Add an anniversary diary entry for the selected date
  519.      (`insert-anniversary-diary-entry').
  520. `i b'
  521.      Add a block diary entry for the current region
  522.      (`insert-block-diary-entry').
  523. `i c'
  524.      Add a cyclic diary entry starting at the date
  525.      (`insert-cyclic-diary-entry').
  526.    If you want to make a diary entry that applies to the anniversary of
  527. a specific date, move point to that date and use the `i a' command.
  528. This displays the end of your diary file in another window and inserts
  529. the anniversary description; you can then type the rest of the diary
  530. entry.  The entry looks like this:
  531.      %%(diary-anniversary 10 31 1948) Arthur's birthday
  532. This entry applies to October 31 in any year after 1948; `10 31 1948'
  533. specifies the date.  (If you are using the European calendar style, the
  534. month and day are interchanged.)  The reason this expression requires a
  535. beginning year is that advanced diary functions can use it to calculate
  536. the number of elapsed years.
  537.    You can make a diary entry entry for a block of dates by setting the
  538. mark at the date at one end of the block, moving point to the date at
  539. the other end of the block, and using the `i b' command.  This command
  540. causes the end of your diary file to be displayed in another window and
  541. the block description to be inserted; you can then type the diary
  542. entry.  Here is a block diary entry that applies to all dates from June
  543. 24, 1990 through July 10, 1990:
  544.      %%(diary-block 6 24 1990 7 10 1990) Vacation
  545. The `6 24 1990' indicates the starting date and the `7 10 1990'
  546. indicates the stopping date.  (Again, if you are using the European
  547. calendar style, the month and day are interchanged.)
  548.    "Cyclic" diary entries repeat after a fixed interval of days.  To
  549. create one, select the starting date and use the `i c' command.  The
  550. command prompts for the length of interval, then inserts the entry.  It
  551. looks like this:
  552.      %%(diary-cyclic 50 3 1 1990) Renew medication
  553. which applies to March 1, 1990 and every 50th day following; `3 1 1990'
  554. specifies the starting date.  (If you are using the European calendar
  555. style, the month and day are interchanged.)
  556.    All three of the these commands make marking diary entries.  If you
  557. want the diary entry to be nonmarking, give a numeric argument to the
  558. command.  For example, `C-u i a' makes a nonmarking anniversary diary
  559. entry.
  560.    Marking sexp diary entries in the calendar is *extremely*
  561. time-consuming, since every date visible in the calendar window must be
  562. individually checked.  So it's a good idea to make sexp diary entries
  563. nonmarking (with `&') when possible.
  564.    Another sophisticated kind of sexp entry, a "floating" diary entry,
  565. specifies a regularly-occurring event by offsets specified in days,
  566. weeks, and months.  It is comparable to a crontab entry interpreted by
  567. the `cron' utility.  Here is a nonmarking, floating diary entry that
  568. applies to the last Thursday in November:
  569.      &%%(diary-float 11 4 -1) American Thanksgiving
  570. The 11 specifies November (the eleventh month), the 4 specifies Thursday
  571. (the fourth day of the week, where Sunday is numbered zero), and the -1
  572. specifies "last" (1 would mean "first", 2 would mean "second", -2 would
  573. mean "second-to-last", and so on).  The month can be a single month or
  574. a list of months.  Thus you could change the 11 above to `'(1 2 3)' and
  575. have the entry apply to the last Thursday of January, February, and
  576. March.  If the month is `t', the entry applies to all months of the
  577. year.
  578.    Most generally, special diary entries can perform arbitrary
  579. computations to determine when they apply.  *Note Sexp Diary Entries:
  580. (elisp)Sexp Diary Entries.
  581. File: emacs,  Node: Appointments,  Next: Daylight Savings,  Prev: Diary,  Up: Calendar/Diary
  582. Appointments
  583. ============
  584.    If you have a diary entry for an appointment, and that diary entry
  585. begins with a recognizable time of day, Emacs can warn you, several
  586. minutes beforehand, that that appointment is pending.  Emacs alerts you
  587. to the appointment by displaying a message in the mode line.
  588.    To enable appointment notification, you must enable the time display
  589. feature of Emacs, `M-x display-time' (*note Mode Line::.).  You must
  590. also add the function `appt-make-list' to the `diary-display-hook',
  591. like this:
  592.      (add-hook 'diary-display-hook 'appt-make-list)
  593.    With these preparations done, when you display the diary (either with
  594. the `d' command in the calendar window or with the `M-x diary'
  595. command), it sets up an appointment list of all the diary entries found
  596. with recognizable times of day, and reminds you just before each of
  597. them.
  598.    For example, if you the diary file contains these lines:
  599.      Monday
  600.        9:30am Coffee break
  601.       12:00pm Lunch
  602. Then on Mondays, after you have displayed the diary, you will be
  603. reminded at 9:20am about your coffee break and at 11:50am about lunch.
  604.    Diary entries can have the time in the conventional American style,
  605. or in "military" style.  You need not be consistent; your diary file can
  606. have a mixture of the two styles.
  607.    Emacs updates the appointments list automatically just after
  608. midnight.  This also displays the next days' diary entries in the diary
  609. buffer, unless you set `appt-display-diary' to `nil'.
  610.    You can also use the appointment notification facility like an alarm
  611. clock.  The command `M-x appt-add' adds entries to the appointment list
  612. without affecting your diary file.  You delete entries from the
  613. appointment list with `M-x appt-delete'.
  614.    You can turn off the appointment notification feature at any time by
  615. setting `appt-issue-message' to `nil'.
  616. File: emacs,  Node: Daylight Savings,  Prev: Appointments,  Up: Calendar/Diary
  617. Daylight Savings Time
  618. =====================
  619.    Emacs understands the difference between standard time and daylight
  620. savings time--the times given for sunrise, sunset, solstices,
  621. equinoxes, and the phases of the moon take that into account.  The rules
  622. for daylight savings time vary from place to place and have also varied
  623. historically from year to year.  To do the job properly, Emacs needs to
  624. know which rules to use.
  625.    Some operating systems keep track of the rules that apply to the
  626. place where you are; on these systems, Emacs gets the information it
  627. needs from the system automatically.  If the system does not know the
  628. rules, you can tell Emacs the rules to use by setting certain variables.
  629.    If the system's data indicate that your area currently uses daylight
  630. savings time, the default starting and stopping dates for daylight
  631. savings time are the present-day American rules of the first Sunday in
  632. April until the last Sunday in October.  If this isn't right, you can
  633. specify whatever rules you want by setting
  634. `calendar-daylight-savings-starts' and
  635. `calendar-daylight-savings-ends'.  Their values should be Lisp
  636. expressions that refer to the variable `year', and evaluate to the
  637. Gregorian date on which daylight savings time starts or (respectively)
  638. ends, in the form of a list `(MONTH DAY YEAR)'.  The values should be
  639. `nil' if your area does not use daylight savings time.
  640.    Emacs uses these expressions to determine the starting date of
  641. daylight savings time for the holiday list and for correcting times of
  642. day in the solar and lunar calculations.
  643.    The default value of `calendar-daylight-savings-starts' is this,
  644.      (calendar-nth-named-day 1 0 4 year)
  645. which computes the first 0th day (Sunday) of the fourth month (April) in
  646. the year specified by `year'.  If daylight savings time were changed to
  647. start on October 1, you would set `calendar-daylight-savings-starts' to
  648. this:
  649.      (list 10 1 year)
  650.    If there is no daylight savings time at your location, or if you want
  651. all times in standard time, set `calendar-daylight-savings-starts' and
  652. `calendar-daylight-savings-ends' to `nil'.
  653.    In some areas, the difference between daylight savings time and
  654. standard time is not one hour.  If this is so in your location, set the
  655. variable `calendar-daylight-time-offset' to the difference, measured in
  656. minutes.
  657.    If the transition to or from daylight savings time does not take
  658. place at 2AM, you can specify when it takes place by setting the
  659. variable `calendar-daylight-savings-switchover-time'.  Its value is the
  660. number of minutes after midnight of the time when the transition should
  661. occur.
  662. File: emacs,  Node: GNUS,  Next: Sorting,  Prev: Calendar/Diary,  Up: Top
  663.    GNUS is an Emacs subsystem for reading and responding to netnews.
  664. You can use GNUS to browse through news groups, look at summaries of
  665. articles in specific group, and read articles of interest.  You can
  666. respond to authors or write replies to all the readers of a news group.
  667.    This section introduces GNUS and describes several basic features.
  668. Full documentation will appear elsewhere.
  669.    To start GNUS, type `M-x gnus RET'.
  670. * Menu:
  671. * Buffers of GNUS::   The Newsgroups, Summary and Article buffers.
  672. * GNUS Startup::      What you should know about starting GNUS.
  673. * Summary of GNUS::   A short description of the basic GNUS commands.
  674. File: emacs,  Node: Buffers of GNUS,  Next: GNUS Startup,  Up: GNUS
  675. GNUS's Three Buffers
  676. --------------------
  677.    GNUS creates and uses three Emacs buffers, each with its own
  678. particular purpose and its own major mode.
  679.    The "Newsgroup buffer" contains a list of newsgroups.  This is the
  680. first buffer that GNUS displays when it starts up.  Normally the list
  681. contains only the newsgroups to which you subscribe (which are listed in
  682. your `.newsrc' file) and which contain unread articles.  Use this
  683. buffer to select a specific newsgroup.
  684.    The "Summary buffer" lists the articles in a single newsgroup,
  685. including their subjects, their numbers, and who posted them.  GNUS
  686. creates a Summary buffer for a newsgroup when you select the group in
  687. the Newsgroup buffer.  Use this buffer to select an article, and to move
  688. around in an article.
  689.    The "Article buffer" displays the text of an article.  You rarely
  690. need to select this buffer because you can read the text while keeping
  691. the Summary buffer selected.
  692. File: emacs,  Node: GNUS Startup,  Next: Summary of GNUS,  Prev: Buffers of GNUS,  Up: GNUS
  693. When GNUS Starts Up
  694. -------------------
  695.    At startup, GNUS reads your `.newsrc' news initialization file and
  696. attempts to communicate with the local news server, which is a
  697. repository of news articles.  The news server need not be the same
  698. computer you are logged in on.
  699.    If you start GNUS and connect to the server, but do not see any
  700. newsgroups listed in the Newsgroup buffer, type `L' to get a listing of
  701. all the newsgroups.  Then type `u' to unsubscribe from particular
  702. newsgroups.  (Move the cursor using `n' and `p' or the usual Emacs
  703. commands.)
  704.    When you quit GNUS with `q', it automatically records in your
  705. `.newsrc' initialization file the subscribed or unsubscribed status of
  706. all newsgroups, except for groups you have "killed".  (You do not need
  707. to edit this file yourself, but you may.)  When new newsgroups come
  708. into existence, GNUS adds them automatically.
  709. File: emacs,  Node: Summary of GNUS,  Prev: GNUS Startup,  Up: GNUS
  710. Summary of GNUS Commands
  711. ------------------------
  712.    Reading news is a two step process:
  713.   1. Choose a newsgroup in the Newsgroup buffer.
  714.   2. Select articles from the Summary buffer.  Each article selected is
  715.      displayed in the Article buffer in a large window, below the
  716.      Summary buffer in its small window.
  717.    Each buffer has commands particular to it, but commands that do the
  718. same things have similar keybindings.  Here are commands for the
  719. Newsgroup and Summary buffers:
  720.      In the Newsgroup buffer, suspend GNUS.  You can return to GNUS
  721.      later by selecting the Newsgroup buffer and typing `g' to get
  722.      newly arrived articles.
  723.      In the Newsgroup buffer, update your `.newsrc' initialization file
  724.      and quit GNUS.
  725.      In the Summary buffer, exit the current newsgroup and return to the
  726.      Newsgroup buffer.  Thus, typing `q' twice quits GNUS.
  727.      In the Newsgroup buffer, list all the newsgroups available on your
  728.      news server.  This may be a long list!
  729.      In the Newsgroup buffer, list only the newsgroups to which you
  730.      subscribe and which contain unread articles.
  731.      In the Newsgroup buffer, unsubscribe from (or subscribe to) the
  732.      newsgroup listed in the line that point is on.  When you quit GNUS
  733.      by typing `q', GNUS lists your subscribed-to newsgroups in your
  734.      `.newsrc' file.  The next time you start GNUS, you see only the
  735.      newsgroups listed in your `.newsrc' file.
  736. `C-k'
  737.      In the Newsgroup buffer, "kill" the current line's newsgroup--don't
  738.      show it in the Newsgroup buffer from now on.  This affects future
  739.      GNUS sessions as well as the present session.
  740.      When you quit GNUS by typing `q', GNUS writes information in the
  741.      file `.newsrc' describing all newsgroups except those you have
  742.      "killed."
  743. `SPC'
  744.      In the Newsgroup buffer, select the group on the line under the
  745.      cursor and display the first unread article in that group.
  746.      In the Summary buffer,
  747.         - Select the article on the line under the cursor if none is
  748.           selected.
  749.         - Scroll the text of the selected article (if there is one).
  750.         - Select the next unread article if at the end of the current
  751.           article.
  752.      Thus, you can move through all the articles by repeatedly typing
  753.      SPC.
  754. `DEL'
  755.      In the Newsgroup Buffer, move point to the previous newsgroup
  756.      containing unread articles.
  757.      In the Summary buffer, scroll the text of the article backwards.
  758.      Move point to the next unread newsgroup, or select the next unread
  759.      article.
  760.      Move point to the previous unread newsgroup, or select the previous
  761.      unread article.
  762. `C-n'
  763. `C-p'
  764.      Move point to the next or previous item, even if it is marked as
  765.      read.  This does not select the article or newsgroup on that line.
  766.      In the Summary buffer, do an incremental search of the current
  767.      text in the Article buffer, just as if you switched to the Article
  768.      buffer and typed `C-s'.
  769. `M-s REGEXP RET'
  770.      In the Summary buffer, search forward for articles containing a
  771.      match for REGEXP.
  772. `C-c C-s C-n'
  773. `C-c C-s C-s'
  774. `C-c C-s C-d'
  775. `C-c C-s C-a'
  776.      In the Summary buffer, sort the list of articles by number,
  777.      subject, date, or author.
  778. `C-M-n'
  779. `C-M-p'
  780.      In the Summary buffer, read the next or previous article with the
  781.      same subject as the current article.
  782. File: emacs,  Node: Sorting,  Next: Shell,  Prev: GNUS,  Up: Top
  783. Sorting Text
  784. ============
  785.    Emacs provides several commands for sorting text in the buffer.  All
  786. operate on the contents of the region (the text between point and the
  787. mark).  They divide the text of the region into many "sort records",
  788. identify a "sort key" for each record, and then reorder the records
  789. into the order determined by the sort keys.  The records are ordered so
  790. that their keys are in alphabetical order, or, for numeric sorting, in
  791. numeric order.  In alphabetic sorting, all upper case letters `A'
  792. through `Z' come before lower case `a', in accord with the ASCII
  793. character sequence.
  794.    The various sort commands differ in how they divide the text into
  795. sort records and in which part of each record is used as the sort key.
  796. Most of the commands make each line a separate sort record, but some
  797. commands use paragraphs or pages as sort records.  Most of the sort
  798. commands use each entire sort record as its own sort key, but some use
  799. only a portion of the record as the sort key.
  800. `M-x sort-lines'
  801.      Divide the region into lines, and sort by comparing the entire
  802.      text of a line.  A prefix argument means sort into descending
  803.      order.
  804. `M-x sort-paragraphs'
  805.      Divide the region into paragraphs, and sort by comparing the entire
  806.      text of a paragraph (except for leading blank lines).  A prefix
  807.      argument means sort into descending order.
  808. `M-x sort-pages'
  809.      Divide the region into pages, and sort by comparing the entire
  810.      text of a page (except for leading blank lines).  A prefix
  811.      argument means sort into descending order.
  812. `M-x sort-fields'
  813.      Divide the region into lines, and sort by comparing the contents of
  814.      one field in each line.  Fields are defined as separated by
  815.      whitespace, so the first run of consecutive non-whitespace
  816.      characters in a line constitutes field 1, the second such run
  817.      constitutes field 2, etc.
  818.      Specify which field to sort by with a numeric argument: 1 to sort
  819.      by field 1, etc.  A negative argument means sort into descending
  820.      order.  Thus, minus 2 means sort by field 2 in
  821.      reverse-alphabetical order.  If several lines have identical
  822.      contents in the field being sorted, they keep same relative order
  823.      that they had in the original buffer.
  824. `M-x sort-numeric-fields'
  825.      Like `M-x sort-fields' except the specified field is converted to
  826.      a number for each line, and the numbers are compared.  `10' comes
  827.      before `2' when considered as text, but after it when considered
  828.      as a number.
  829. `M-x sort-columns'
  830.      Like `M-x sort-fields' except that the text within each line used
  831.      for comparison comes from a fixed range of columns.  See below for
  832.      an explanation.
  833.    For example, if the buffer contains this:
  834.      On systems where clash detection (locking of files being edited) is
  835.      implemented, Emacs also checks the first time you modify a buffer
  836.      whether the file has changed on disk since it was last visited or
  837.      saved.  If it has, you are asked to confirm that you want to change
  838.      the buffer.
  839. then applying `M-x sort-lines' to the entire buffer produces this:
  840.      On systems where clash detection (locking of files being edited) is
  841.      implemented, Emacs also checks the first time you modify a buffer
  842.      saved.  If it has, you are asked to confirm that you want to change
  843.      the buffer.
  844.      whether the file has changed on disk since it was last visited or
  845. where the upper case `O' sorts before all lower case letters.  If you
  846. use `C-u 2 M-x sort-fields' instead, you get this:
  847.      implemented, Emacs also checks the first time you modify a buffer
  848.      saved.  If it has, you are asked to confirm that you want to change
  849.      the buffer.
  850.      On systems where clash detection (locking of files being edited) is
  851.      whether the file has changed on disk since it was last visited or
  852. where the sort keys were `Emacs', `If', `buffer', `systems' and `the'.
  853.    `M-x sort-columns' requires more explanation.  You specify the
  854. columns by putting point at one of the columns and the mark at the other
  855. column.  Because this means you cannot put point or the mark at the
  856. beginning of the first line to sort, this command uses an unusual
  857. definition of `region': all of the line point is in is considered part
  858. of the region, and so is all of the line the mark is in.
  859.    For example, to sort a table by information found in columns 10 to
  860. 15, you could put the mark on column 10 in the first line of the table,
  861. and point on column 15 in the last line of the table, and then run
  862. `sort-columns'.  Equivalently, you could run it with the mark on column
  863. 15 in the first line and point on column 10 in the last line.
  864.    This can be thought of as sorting the rectangle specified by point
  865. and the mark, except that the text on each line to the left or right of
  866. the rectangle moves along with the text inside the rectangle.  *Note
  867. Rectangles::.
  868. File: emacs,  Node: Shell,  Next: Narrowing,  Prev: Sorting,  Up: Top
  869. Running Shell Commands from Emacs
  870. =================================
  871.    Emacs has commands for passing single command lines to inferior shell
  872. processes; it can also run a shell interactively with input and output
  873. to an Emacs buffer `*shell*'.
  874. `M-!'
  875.      Run a specified shell command line and display the output
  876.      (`shell-command').
  877. `M-|'
  878.      Run a specified shell command line with region contents as input;
  879.      optionally replace the region with the output
  880.      (`shell-command-on-region').
  881. `M-x shell'
  882.      Run a subshell with input and output through an Emacs buffer.  You
  883.      can then give commands interactively.
  884. * Menu:
  885. * Single Shell::           How to run one shell command and return.
  886. * Interactive Shell::      Permanent shell taking input via Emacs.
  887. * Shell Mode::             Special Emacs commands used with permanent shell.
  888. * History: Shell History.  Repeating previous commands in a shell buffer.
  889.